<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTallyDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tally_details', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('tally_id')->comment('理货单');
            $table->string('barcode', 64)->comment('产品条码');
            $table->unsignedInteger('quantity')->default(0)->comment('产品数量');
            $table->string('batch', 50)->comment('批次号');
            $table->tinyInteger('attribute')->comment('产品属性: 0 良品 1 不良品 2 可销售不良品');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tally_details');
    }
}
